/******************************************************************************
 * @Filename     : qspi.h
 *
 * @Version      : V1.0
 * @Subversion   : $
 * @Last modified: 04/30/2020 16:01:41
 * @Modified by  : Mxy
 *
 * @Brief        : QSPI driver header file
 *
 * Copyright (C) 2020 SKYRELAY Technology co.,Ltd All rights reserved.
 *****************************************************************************/
#ifndef __RC2412_QSPI_DEF_H__
#define __RC2412_QSPI_DEF_H__

#ifdef __cplusplus
extern "C"
{
#endif

	
	
#define QSPI_CLOCK_DIV                 (0x00ul)
	
#define QSPI_DUMMY_DATA                (0xFF)	
	
//user config para
#define QSPI_READ_CMD_QUAD             (0xEBul)
#define QSPI_READ_CMD_DUAL             (0xBBul)
#define QSPI_DUMMY_DATA_LEN_QUAD       (0x05ul)	
#define QSPI_DUMMY_DATA_LEN_DUAL       (0x03ul)
#define	QSPI_BOOT_SEL_BOOT             (0x01ul)
#define	QSPI_BOOT_SEL_NORMAL           (0x00ul)
#define	QSPI_CPOL                      (0x00ul)
#define	QSPI_CPHA                      (0x00ul)
#define QSPI_CS_CS_LOW                 (0x00ul)
#define QSPI_CS_CS_HIGH                (0x01ul)

//Continous read mode. dual and quad
#define QSPI_CON_READ_MODE_FIRST_STEP  (0xA5)
#define QSPI_CON_READ_MODE_SECOND_STEP (0x5A)

typedef enum
{
    QSPI_STANDARD        = 0x00ul,     /* single */
    QSPI_DUAL_INPUT      = 0x01ul,     /* dual input */
    QSPI_DUAL_OUTPUT     = 0x02ul,     /* dual output */
    QSPI_QUAD_INPUT      = 0x03ul,     /* quad input */
    QSPI_QUAD_OUTPUT     = 0x04ul,     /* quad output */	
    QSPI_OTHER           = QSPI_STANDARD,
} qspi_frame_mode_t;

enum qspi_status_t {
    QSPI_OK = 0,
    QSPI_BUSY,
    QSPI_ERROR,
    QSPI_PARA_ERROR,
};

enum exflash_read_t {
	EXFLASH_STANDARD_FAST = 0,
	EXFLASH_STANDARD,
	EXFLASH_DUAL,
	EXFLASH_DUAL_FAST,
	EXFLASH_QUAD,
	EXFLASH_QUAD_FAST,
};

#ifdef __cplusplus
}
#endif
#endif


